<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
use app\api\middleware\BlockerMiddleware;
use think\facade\Route;
use think\facade\Config;
use think\Response;
use app\http\middleware\AllowOriginMiddleware;
Route::group(function () {
    Route::any('Post_WeChatpay', 'v2.WxPayController/WeChatpay')->option(['real_name' => '微信支付']);//微信支付
    Route::any('Post_WeChatpay_refund', 'v2.WxPayController/WeChatpay_refund')->option(['real_name' => '微信支付退款']);//微信支付退款
    Route::any('Post_bonus', 'v2.WxPayController/bonus')->option(['real_name' => '发起分账']);//发起分账
    Route::any('Post_return_bonus', 'v2.WxPayController/return_bonus')->option(['real_name' => '分账回退']);//分账回退
    Route::any('Post_decrypt', 'v2.WxPayController/decrypt')->option(['real_name' => 'V3微信支付回调数据解密']);//V3微信支付回调数据解密

})->option(['mark' => 'serve', 'mark_name' => '微信支付服务接口11112']);

Route::group(function () {
    Route::any('Post_Alipay', 'v2.AlipayController/Alipay')->option(['real_name' => '支付宝支付']);//支付宝支付
    Route::any('Post_Alipay_refund', 'v2.AlipayController/WeChatpay_refund')->option(['real_name' => '支付宝支付退款']);//支付宝支付退款
    Route::any('Post_Alipay_bonus', 'v2.AlipayController/bonus')->option(['real_name' => '支付宝发起分账']);//支付宝发起分账
    Route::any('Post_Alipay_return_bonus', 'v2.AlipayController/return_bonus')->option(['real_name' => '支付宝分账回退']);//支付宝分账回退
})->option(['mark' => 'serve', 'mark_name' => '支付宝支付服务接口']);


Route::group(function () {
    Route::any('Post_smfpay', 'v2.SmfController/smfpay')->option(['real_name' => '扫码富支付']);//扫码富支付
    Route::any('Smf_mediaUpload', 'v2.SmfController/mediaUpload')->option(['real_name' => '扫码富特约商户上传图片获取OSS上传凭证']);//扫码富特约商户上传图片获取OSS上传凭证
    Route::any('get_smf_mcc', 'v2.SmfController/get_smf_mcc')->option(['real_name' => '扫码富获取行业编号']);//扫码富获取行业编号
    Route::any('get_bank_code', 'v2.SmfController/get_bank_code')->option(['real_name' => '扫码富获取银行编号']);//扫码富获取银行编号
    Route::any('get_bank_branch', 'v2.SmfController/get_bank_branch')->option(['real_name' => '根据银行编号查询该银行下面所有支行信息']);//根据银行编号查询该银行下面所有支行信息
    Route::any('get_smf_city_code', 'v2.SmfController/get_smf_city_code')->option(['real_name' => '省市区编码']);//省市区编码
    Route::any('getImageDownloadUrl', 'v2.SmfController/getImageDownloadUrl')->option(['real_name' => '扫码富获取图片下载地址']);//扫码富获取图片下载地址
    Route::any('queryCheckResult', 'v2.SmfController/queryCheckResult')->option(['real_name' => '查询商户审核结果']);//查询商户审核结果
    Route::any('smf_Sign', 'v2.SmfController/smf_Sign')->option(['real_name' => '发起签约商户进件且通道需要签约，通过此接口发起签约。签约状态为待签约，才能发起签约。']);//发起签约商户进件且通道需要签约，通过此接口发起签约。签约状态为待签约，才能发起签约。
    Route::any('verifySignedSms', 'v2.SmfController/verifySignedSms')->option(['real_name' => '校验签约短信']);//校验签约短信
    Route::any('getRealNameAuthInfo', 'v2.SmfController/getRealNameAuthInfo')->option(['real_name' => '获取实名认证信息']);//获取实名认证信息
    Route::any('queryBalance', 'v2.SmfController/queryBalance')->option(['real_name' => '根据商户号查询扫码富余额']);//根据商户号查询扫码富余额
    Route::any('post_ynyvendor', 'v2.SmfController/post_ynyvendor')->option(['real_name' => '根据商户号查询扫码富余额']);//根据商户号查询扫码富余额
    Route::any('post_ynyvendor2', 'v2.SmfController/post_ynyvendor2')->option(['real_name' => '手动推送数据到约你游商户2 邱邱用2025年1月7日15:44:54']);//手动推送数据到约你游商户2 邱邱用2025年1月7日15:44:54

    Route::any('smf_refund', 'v2.SmfController/smf_refund')->option(['real_name' => '扫码付退款']);//扫码付退款
    Route::any('smf_queryPayOrder', 'v2.SmfController/queryPayOrder')->option(['real_name' => '扫码富查询订单支付状态']);//扫码富查询订单支付状态




})->option(['mark' => 'serve', 'mark_name' => '扫码富服务接口']);


Route::group(function () {
    Route::any('three_in_one_Pay', 'v2.ThreeinonePayController/polymerization_Pay')->option(['real_name' => '三合一支付']);//三合一支付
})->option(['mark' => 'serve', 'mark_name' => '三合一支付']);


Route::miss(function () {
    if (app()->request->isOptions()) {
        $header = Config::get('cookie.header');
        unset($header['Access-Control-Allow-Credentials']);
        return Response::create('ok')->code(200)->header($header);
    } else
        return Response::create()->code(404);
});
